
apiready = function(){
headerstatus()
	var shopid = api.pageParam.shopId;
	var uid = $api.getStorage('user').uid;
	getWinGoodsDetail(shopid)
	
}
//获取奖单详情
function getWinGoodsDetail(shopid){
	api.ajax({
        url: 'http://wap.jqmao.cn/getWinGoodsDetail?shopid='+shopid,
        method: 'get'     
    }, function (ret, err) {
    	if(ret){
    	//alert(JSON.stringify(ret))
    		var content = $api.byId('WinGoodsDetail-content');
            var tpl = $api.byId('WinGoodsDetail-template').text;
            var tempFn = doT.template(tpl);
            $api.html(content, tempFn(ret));
    	}else{
    		////alert(JSON.stringify(err))
    	}
    	
    })
}
function submt(shopid){
	api.confirm({
	    title: '确定收货',
	    msg: '亲，是否确定收货？',
	    buttons: ['确定', '取消']
	}, function(ret, err){
	    var index = ret.buttonIndex;
	    if(index==1){
	    	api.ajax({
        	url: 'http://wap.jqmao.cn/updateWinOrderStatus?shopid='+shopid,
       			 method: 'get'     
    		},function(ret,err){
    			if(ret.code==1){
    				getWinGoodsDetail(shopid)
    			}else{
    				toast("操作失败")
    			}
    		})
	    }
	});
}